<?php
global $_W,$_GPC;

$uniacid = $_W['uniacid'];
$id = $_GPC['rid'];
$openid = $_W[openid];

$viewer = pdo_fetch('SELECT * FROM ' . tablename('bbyscm_card') . ' WHERE `uniacid` = :uniacid AND `id` = :id', array(':uniacid' => $uniacid,':id' => $id) );

pdo_update('bbyscm_card', array('openid'=>$openid), array('id' => $viewer['id']));

message('授权成功！');
?>